home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d3
/
allmac21.arc
/
COLUMN10.ARC
/
COLUMN10.QM
< prev
next >
Wrap
Text File
|
1990-08-27
|
15KB
|
394 lines
* COLUMN10.QM, v1.0e
*
* The following macros produce a single column of the commands
* contained in a txtfile converted from a macfile by QMAC:
*
* @1 - slowest, may need editing
* @2 - does not use batch files, requires no editing
* @3 - fastest and smallest (103 bytes), uses batch files included,
* requires no editing. ** RECOMMEND @3 as macro to use **
*
* You may find these macros useful in understanding how a macro
* works, or if you want to modify a QMAC txtfile, it may be a little
* easier to do so with commands in a single column.
*
* Insert must be ON. Change "C:" to ram drive for faster operation.
*
* VERSION HISTORY:
*
* 1.0 - initial
* 1.0a - reduced size
* 1.0b - modified to reduce editing for quotes and spaces
* 1.0c - documentation changed
* 1.0d - added @2 & @3
* 1.0e - minor documentation changes
* - changed file name dum to c:$
*
*┌────────────────────────────────────────────────────────────┐
*│The following txtfile was converted by QMAC from @1 │
*└────────────────────────────────────────────────────────────┘
*
@1 MacroBegin UnmarkBlock InsertLine MarkColumn CurrentFilename
StoreScrbuff "1" Return DelLine CursorDown PrevPara
MarkBlockBegin EndPara MarkBlockEnd FindReplace """ """
Return """\""" Return "LN" Return FindReplace """ """ Return
"""\\""" Return "LN" Return PrevPara BegLine WordRight
Label2: CursorLeft Find " " Return "L" Return Return Label1:
CursorLeft JFalse Label0: DelCh Jump Label1: Label0: Find " "
Return "L" Return JTrue Label2: GotoBlockBeg MarkColumn
PrevPosition MarkColumn PrevPosition Label4: Find " " Return
"L" Return JFalse Label3: DelCh Jump Label4: Label3:
GotoColumn "60" Return MarkColumn GotoBlockBeg CursorDown
MarkBlockBegin ShiftRight RepeatCmd "7" Return CursorUp
MarkBlockBegin Cut EditFile "c:$" Return KillFile Quit
EditFile Return Paste BegFile Label6: EndPara CursorDown
JFalse Label5: Label7: EndLine BegLine JTrue Label6: DelLine
JTrue Label7: Label5: SaveFile GetScrbuff "1" Return Cut
EditFile Paste Return ReadBlock "c:$" Return FindReplace "\"
Return " " Return "LN" Return GotoBlockBeg
* 187 bytes Thu 08-23-1990 14:26:18
* ┌────────────────────────────────────────────────────────────────┐
* │@1 Makes single column of commands from QMAC txtfile │
* └────────────────────────────────────────────────────────────────┘
* Here's a handy macro to convert QMAC txtfiles to a single column of
* commands. After running this macro by placing the cursor line
* anywhere in any QMAC produced txtfile you should see a single column
* of commands.
*
* An earlier version 1.0 of this macro required editing of macro
* commands containing "space" ( quote space quote). This macro
* produces a single column macro that, when converted by QMAC, requires
* less editing, even though some editing still may be required after
* running depending on the macro. Any command containing 'd:\path' is
* still split into two lines requiring editing. Other combination of
* quotes and spaces and other commands may also need editing. I am sure
* there are more.
*
* Macros to be converted to single column with @1 must have blank
* lines at begin and end. CAUTION: immediately after running this
* macro, test it by converting the QMAC single column txtfile to a
* macfile, and edit those lines that did not convert correctly. Then
* convert the single column txtfile back to a macfile, read it, and
* run as a test. Macros @2 & @3 were written after realizing the
* shortcomings and complexities of @1. I guess some of us tend
* to make things complicated at first until we figure out how to
* make them simple and foolproof!
@1 macrobegin
***************************************** GET FILENAME TO SCRBUFF 1
unmarkblock * unmarkblock
insertline * insert temp line
markcolumn * markcolumn
currentfilename * get currentfilename
storescrbuff "1" return * to scrbuff 1
delline * delete temp line
***************************************** BREAK MACRO INTO COLUMN
cursordown * move down one line
prevpara * get to begin para
markblockbegin * mark begin para
endpara *
markblockend * mark end para
findreplace * replace
#34 #32 #34 return * " "
#34 #92 #34 return * with "\"
"LN" return * block only
findreplace * replace
#34 #32 #32 #34 return * " "
#34 #92 #92 #34 return * with "\\"
"LN" return * block only
prevpara *
begline * get back to begin para
wordright * get to key
STARTSPACE: *
cursorleft * get off word
find " " return "L" return * find next space
return * puts command on next line
***************************************** LINE UP COMMANDS IN COL 1
BEGINSPACE: *
cursorleft * get off command
jfalse DONESPACE: *
delch * delete blank space to col 1
jump BEGINSPACE: *
DONESPACE: *
find " " return "L" return * look for more single spaces
jtrue STARTSPACE: * go find next command
***************************************** MARK COLUMN 1 AS BLOCK
gotoblockbeg * get to col 1 2nd line
markcolumn * mark it
prevposition * get to bottom line col 1
markcolumn * mark it
prevposition * go bak to line 2
***************************************** DELETE BLANK SPACES IN COL 1
AGAIN: *
find " " return "L" return * find first blank space down
jfalse NEXT: * get ready to shiftright
delch * delete it
jump AGAIN: * look for more
NEXT: *
***************************************** SHIFT RIGHT/ CUT TO TEMP
gotocolumn "60" return * get long commands in block
markcolumn * mark end
gotoblockbeg * go back to block begin
cursordown * drop down 1 to shift rest
markblockbegin * mark block to shift
shiftright * shift all but line 1 right
repeatcmd "7" return
cursorup * get back to block begin
markblockbegin * get line 1 in block
cut * cut lined up block to scrap
editfile "c:$" return * find tempfile in ring
killfile * kill it on disk
quit * quit ring
editfile return * edit new tempfile
paste * paste lined up block to temp
*************************************** * REMOVE BLANK LINES IN BLOCK
begfile *
NOTBLANK: *
endpara *
cursordown *
jfalse NOMORE: *
BLANK: *
endline *
begline *
jtrue NOTBLANK: *
delline *
jtrue BLANK: *
NOMORE: *
**************************************** GET BLOCK BACK TO FILE
savefile * save tempfile to disk
getscrbuff "1" return * get currentfilename
cut * cut to scrap
editfile paste return * load orig file
readblock "c:$" return * read block/no blnk lines
findreplace #92 return * replace \
#32 return "LN" return * with space
***************************************** INDENT LABELS
END: *
gotoblockbeg *
* 187 bytes Thu 08-23-1990 14:26:38
* ┌─────────────────────────────────────────────────────────────┐
* │The following txtfile was produced when @1 is run │
* │with cursor line in the QMAC txtfile at the beginning │
* └─────────────────────────────────────────────────────────────┘
* (asterisks added Thu 08-23-1990 )
*
* @1
* MacroBegin
* UnmarkBlock
* InsertLine
* MarkColumn
* CurrentFilename
* StoreScrbuff
* "1"
* Return
* DelLine
* CursorDown
* PrevPara
* MarkBlockBegin
* EndPara
* MarkBlockEnd
* FindReplace
* """ """
* Return
* """ """
* Return
* "LN"
* Return
* FindReplace
* """ """
* Return
* """ """
* Return
* "LN"
* Return
* PrevPara
* BegLine
* WordRight
* Label2:
* CursorLeft
* Find
* " "
* Return
* "L"
* Return
* Return
* Label1:
* CursorLeft
* JFalse
* Label0:
* DelCh
* Jump
* Label1:
* Label0:
* Find
* " "
* Return
* "L"
* Return
* JTrue
* Label2:
* GotoBlockBeg
* MarkColumn
* PrevPosition
* MarkColumn
* PrevPosition
* Label4:
* Find
* " "
* Return
* "L"
* Return
* JFalse
* Label3:
* DelCh
* Jump
* Label4:
* Label3:
* GotoColumn
* "60"
* Return
* MarkColumn
* GotoBlockBeg
* CursorDown
* MarkBlockBegin
* ShiftRight
* RepeatCmd
* "7"
* Return
* CursorUp
* MarkBlockBegin
* Cut
* EditFile
* "c:$"
* Return
* KillFile
* Quit
* EditFile
* Return
* Paste
* BegFile
* Label6:
* EndPara
* CursorDown
* JFalse
* Label5:
* Label7:
* EndLine
* BegLine
* JTrue
* Label6:
* DelLine
* JTrue
* Label7:
* Label5:
* SaveFile
* GetScrbuff
* "1"
* Return
* Cut
* EditFile
* Paste
* Return
* ReadBlock
* "c:$"
* Return
* FindReplace
* " "
* Return
* " "
* Return
* "LN"
* Return
* GotoBlockBeg
*
* * 187 bytes Sun 08-05-1990 17:45:24
* ┌───────────────────────────────────────────────────────────┐
* │@2 Makes single column txtfile from any txtfile. │
* │ Does not use batch files. │
* └───────────────────────────────────────────────────────────┘
* Does the same as @1 but faster. Requires no editing.
* If a macros is not a marked block, the full txtfile is made
* into a single column macro.
@2 macrobegin
writeblock "c:$.qm" * copy block or file to c:$.qm
return return *
***************************************** GET CURRENTFILENAME TO SCRAP
unmarkblock
insertline * insert blank line
begline *
dropanchor * start mark
currentfilename * get currentfilename
storescrbuff "1" return * to scrbuff 1
cut * to scrap
****************************************
dos "QMAC c:$.mac c:$.qm /B /A- " return return * make macfile
dos "QMAC c:$.mac c:$.qm /T /A- /W15 " return return * make txtfile
editfile "c:$.qm" return quit *
editfile return * load c:$.qm
endfile return * insert blank line at end
"*" insertdate inserttime * for date/time
getscrbuff "1" return * and file name
unmarkblock *
savefile * save c:$.qm
* 182 bytes Thu 08-23-1990 14:27:02
* ┌────────────────────────────────────────────────────────┐
* │@3 Makes single column txtfile from any txtfile │
* │ Uses batch files QMACB.BAT and QMACT-N.BAT │
* └────────────────────────────────────────────────────────┘
* Smallest, 102 bytes. Requires no editing.
* If a macro is not a marked block, the full txtfile is made
* into a single column macro.
@3 macrobegin
writeblock "c:$.qm" * copy block or file to c:$.qm
return return *
***************************************** GET CURRENTFILENAME TO SCRAP
insertline * insert blank line
begline *
dropanchor * start mark
currentfilename * get currentfilename
storescrbuff "1" return * to scrbuff 1
cut * to scrap
*****************************************
dos "qmacb c:$" return return * make macfile
dos "qmact-n c:$" return return * make txtfile
editfile "c:$.qm" return quit *
editfile return * load c:$.qm
endfile return * insert blank line at end
"*" insertdate inserttime * for date/time
getscrbuff "1" return * and file name
unmarkblock *
savefile * save c:$.qm
* 103 bytes Sun 08-05-1990 17:50:06
* Tom Hogshead Thu 08-23-1990 13:50:17